package com.hc.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 当前是更改Ribbon 负载均衡算法的配置类
 */
@Configuration
public class RibbonConfig {
    //修改负载均衡的默认算法，需要在spring中从新注入IRule的实现
    @Bean
    public IRule muRule(){
        return new RandomRule();
    }
}

